package com.huakang.service.impl;

import com.huakang.entity.Asset;
import com.huakang.mapper.AssetMapper;
import com.huakang.service.AssetService;
import com.huakang.utils.AssetPatientVo;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Service
@Transactional
public class AssetServiceImpl implements AssetService {

    @Autowired
    private AssetMapper assetMapper;
    @Override
    public List<AssetPatientVo> findAll() {
        return assetMapper.assectPatient();
    }

    @Override
    public List<AssetPatientVo> assetSearch(AssetPatientVo assetPatientVo) {
        return assetMapper.assetSearchs(assetPatientVo);
    }

    @Override
    public Asset findPid(Integer pid) {
        return assetMapper.selectByPid(pid);
    }

    @Override
    public boolean insert(Asset asset) {
        return assetMapper.insertSelective(asset)>0?true:false;
    }

    @Override
    public boolean update(Asset asset) {
        return assetMapper.updateByPrimaryKeySelective(asset)>0?true:false;
    }

}
